import 'package:boss/ui/page/necessaryOrder/widget/necessary_order_browser.dart';
import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:router/annotation.dart';

@RouterConfig(NecessaryOrderPage.pageName)
class NecessaryOrderPage extends StatefulWidget {
  static const pageName = '/necessaryOrderPage';

  @override
  _NecessaryOrderPageState createState() => _NecessaryOrderPageState('开台必点项');
}

class _NecessaryOrderPageState extends BaseState<NecessaryOrderPage> {
  _NecessaryOrderPageState(String pageName) : super(pageName);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CenterTitleAppBar(
        title: '开台必点项',
        actions: <Widget>[
          LabelButton(
            title: '+新增',
            padding: EdgeInsets.only(left: 8, top: 2, bottom: 2),
            onTap: () {
              Navigator.pushNamed(context, '/necessaryOrderDetailPage');
            },
          ),
        ],
      ),
      body: NecessaryOrderBrowser(),
    );
  }
}
